<!DOCTYPE html>
<html>
<head>
<!-- Tested on Mozilla Firefox 7/8. Nothing else. Uses some CSS3 features, so
hopefully your browser supports that. If not, don't you think it's time to
update your browser? I do... -->

<!-- Site uses a modular design. Web pages are inserted into the 'game' and
'side' divs and buttons are pressed. -->

<title>Web Tic Tac Toe App</title>
<link rel="stylesheet" href="style.css" type="text/css" />

<script type="text/javascript" src="loadPages.js"></script>
<script type="text/javascript" src="csspopup.js"></script>

<script type="text/javascript" src="ttt.js"></script>
<script type="text/javascript" src="pvp.js"></script>

<!-- Bits of random javascript -->
<script type="text/javascript">
	var isPvP = false;	//Player vs Player mode

	function init(){
		replacePage('board.htm', 'game');
		replacePage('opponent.htm', 'side');
	}

	function setModePvP(){
	//	loadobjs('pvp.js');
		isPvP = true;
		initPvP();
	}

	function setModeAI(){
	//	loadobjs('ttt.js');
		isPvP = false;
		replacePage('difficulty.htm', 'side');
		initAIPlay();
	}
	
	function resetFiles(){	//Tells servlet to reset the pvp file
		var req = new XMLHttpRequest();
		req.open("get", "servlet/pvp_move/resetFile", true);
		req.send( null );
		
	}
</script>

</head>

<body onload="javascript:init();" >

	<!-- These two divs don't display until popupdiv in JS is called -->
	<div id="blanket" style="display: none;"></div>	
	<div id="popUpDiv" style="display: none;">
		<p style="color: black;">Play Again?</p>
		<a href="javascript:playAgain();"><span style="color: green;">Yes</span></a>
		&nbsp;&nbsp;
		<a href="javascript:popup('popUpDiv');"><span style="color: red;">No</span></a>
	</div>	

<div id="main">
	<div id="header">
		<h1>Welcome to Web Tic-Tac-Toe!</h1>
	</div>

	<div id="cont" align="center">
		<div id="game" align="center">
		</div>
		<div id="side" align="center">
		</div>
	</div>
	
</div>
</body>
</html>
